package com.music.service.members.beans;

import java.util.Date;

import javax.jdo.annotations.IdGeneratorStrategy;
import javax.jdo.annotations.IdentityType;
import javax.jdo.annotations.PersistenceCapable;
import javax.jdo.annotations.Persistent;
import javax.jdo.annotations.PrimaryKey;

import com.music.service.members.constants.Gender;

@PersistenceCapable(identityType = IdentityType.APPLICATION)
public class Member {

	public Member(){
		
	}
	public Member(Long memberId, String firstName, String lastName,
			String password, String passwordHash, Date lastLogin,
			Date birthDate, Date creationDate, Gender gender, String email,
			Date lastUpdateDate) {
		this.memberId = memberId;
		this.firstName = firstName;
		this.lastName = lastName;
		this.password = password;
		this.passwordHash = passwordHash;
		this.lastLogin = lastLogin;
		this.birthDate = birthDate;
		this.creationDate = creationDate;
		this.gender = gender;
		this.email = email;
		this.lastUpdateDate = lastUpdateDate;
	}

	@PrimaryKey
	@Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
	private Long memberId;
	@Persistent
	private String firstName;
	@Persistent
	private String lastName;
	@Persistent
	private String password;
	@Persistent
	private String passwordHash;
	@Persistent
	private Date lastLogin;
	@Persistent
	private Date birthDate;
	@Persistent
	private Date creationDate;
	@Persistent
	private Gender gender;
	@Persistent
	private String email;
	@Persistent
	private Date lastUpdateDate;

	public String getPassword() {
		return password;
	}

	public void setPassword(String password) {
		this.password = password;
	}

	public String getPasswordHash() {
		return passwordHash;
	}

	public void setPasswordHash(String passwordHash) {
		this.passwordHash = passwordHash;
	}

	public Date getLastLogin() {
		return lastLogin;
	}

	public void setLastLogin(Date lastLogin) {
		this.lastLogin = lastLogin;
	}

	public Date getBirthDate() {
		return birthDate;
	}

	public void setBirthDate(Date birthDate) {
		this.birthDate = birthDate;
	}

	public Date getCreationDate() {
		return creationDate;
	}

	public void setCreationDate(Date creationDate) {
		this.creationDate = creationDate;
	}

	public void setMemberId(Long memberId) {
		this.memberId = memberId;
	}

	public Long getMemberId() {
		return memberId;
	}

	public String getEmail() {
		return email;
	}

	public void setEmail(String email) {
		this.email = email;
	}

	public void setGender(Gender gender) {
		this.gender = gender;
	}

	public Gender getGender() {
		return gender;
	}

	public void setFirstName(String firstName) {
		this.firstName = firstName;
	}

	public String getFirstName() {
		return firstName;
	}

	public void setLastName(String lastName) {
		this.lastName = lastName;
	}

	public String getLastName() {
		return lastName;
	}

	public void setLastUpdateDate(Date lastUpdateDate) {
		this.lastUpdateDate = lastUpdateDate;
	}

	public Date getLastUpdateDate() {
		return lastUpdateDate;
	}

	@Override
	public String toString() {
		return "MemberID="+this.memberId +";FirstName="+ this.firstName +";LastName="+ this.lastName +
				 ";LastLogin="+this.lastLogin + ";BirthDate="+this.birthDate
				+ ";CreationDate="+this.creationDate +";Gender="+ this.gender + ";email="+this.email
				+ ";LastUpdateDate="+this.lastUpdateDate;
	}

}
